#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int arr[40010];
int main()
{
	char ch, flag = '0';
	int len = 0;
	int count = 0;
	while (cin >> ch) {
		len++;
		if (ch == flag) {
			arr[count]++;
		}
		else {
			count++;
			arr[count] = 1;
			flag = ch;
		}
	}
	cout << sqrt(len) << " ";
	for (int i = 0; i <= count; i++) {
		cout << arr[i] << " ";
	}
	return 0;
}